#!/bin/bash
gatk=/picb/lilab/tools/gatk-4.2.6.1/gatk

#Reference dir
reference=/picb/lilab5/share_data/ref/hg38/

##shell options
working_dir=$1
sample=$2

if [ ! -d ${working_dir}/vcf ]
then mkdir -p ${working_dir}/vcf
fi

if [ ! -d ${working_dir}/info/${sample} ]
then mkdir -p ${working_dir}/info/${sample}
fi 

#Variants Calling
time $gatk HaplotypeCaller \
    -R $reference/Homo_sapiens.GRCh38.dna.primary_assembly.fa \
    -I ${working_dir}/bam/bqsr/${sample}.sorted.markdup.BQSR.bam \
    -O ${working_dir}/vcf/${sample}.HC.vcf.gz 